<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://ckfinder.com" prefix="ckfinder" %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>

<div class="block">
    
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        <logic:equal name="landForm" property="permitType" value="building">
            <logic:lessThan name="landForm" property="permitID" value="1">
                <h2>Add Building Permit</h2>
            </logic:lessThan>
            <logic:greaterThan name="landForm" property="permitID" value="0">
                <h2>Edit Building Permit</h2>
            </logic:greaterThan>            
        </logic:equal>
        
        <logic:equal name="landForm" property="permitType" value="occupancy">
            <logic:lessThan name="landForm" property="permitID" value="1">
                <h2>Add Occupancy Permit</h2>
            </logic:lessThan>
            <logic:greaterThan name="landForm" property="permitID" value="0">
                <h2>Edit Occupancy Permit</h2>
            </logic:greaterThan>            
        </logic:equal>
    </div>
    <!-- .block_head ends -->
    
    <div class="block_content clearfix">
        <html:form styleClass="validate-form" action="admin/land.do" method="post">
            
            <logic:notEmpty name="errorMessages" >
                <div class="message errormsg">
                    <logic:iterate id="message" name="errorMessages">
                        <p><bean:write name="message"/></p>
                    </logic:iterate>
                </div>
            </logic:notEmpty>
            <logic:notEmpty name="successMessages" >
                <div class="message success">
                    <logic:iterate id="message" name="successMessages">
                        <p><bean:write name="message"/></p>
                    </logic:iterate>
                </div>
            </logic:notEmpty>
            <p>
                <html:hidden property="landID" />
                <html:hidden property="permitType" />
                <html:hidden property="permitID" />
                <label for="issuerName">Issuer Name:</label><span class="required">*</span><br/>
                <html:text styleId="issuerName" styleClass="text medium required" property="issuerName"/>
            </p>
            <p>
                <label for="issuedDate">Issued On:</label><span class="required">*</span><br/>
                <html:text styleId="issuedDate" styleClass="text date_picker required dateISO" property="issuedDate"/>
                <label for="issuedDate" class="note">(yyyy-MM-dd)</label>
                <label for="issuedDate" class="error" generated="true" style="display:none;"></label>
            </p>
            <p>
                <label for="signerName">Signer Name</label><span class="required">*</span><br/>
                <html:text styleId="signerName" styleClass="text medium required" property="signerName"/>
            </p>
            <p>
                <label>Description:</label><br/>
                <html:textarea property="description"/>
                <ckfinder:setupCKEditor basePath="/ckfinder/" editor="description"  />
                <ckeditor:replace basePath="/ckeditor/" replace="description" />
            </p>            
            
            <hr/>
            
            <p>
                <html:hidden property="action" value="savePermit"/>
                <html:submit property="method" value="Save" styleClass="submit small"/>
                <html:link action="/admin/land.do" paramId="landID" paramName="landForm" paramProperty="landID" styleClass="submit small gray">
                    Cancel
                </html:link>
            </p>
            
            
        </div>
        <!-- .block_content ends -->
    </html:form>
        
    <div class="bendl"></div>
    <div class="bendr"></div>
    
</div>
<!-- .block ends -->
